package com.wk.springboot.listener;

import org.springframework.batch.core.ItemProcessListener;
import org.springframework.stereotype.Component;

/**
 * @Classname MyItemProcessingListener
 * @Description 过程监听
 * 必须是core的类才可以
 * @Date 2020/3/31 13:34
 * @Author by weikai
 */
@Component
public class MyItemProcessingListener implements ItemProcessListener {

  @Override
  public void beforeProcess(Object item) {
    System.out.println("开始转换数据");
  }

  @Override
  public void afterProcess(Object item, Object result) {
    System.out.println("结束转换数据");
  }

  @Override
  public void onProcessError(Object item, Exception e) {
    System.out.println("转换数据出");
  }
}
